package com.yangjicong.o2o.studey.base.common.exception;

import com.yangjicong.o2o.studey.base.common.enums.ErrorCodeEnum;
import lombok.Getter;

/**
 * @author zhuweiwei email:zhuweiwei@bestpay.com.cn
 * @version 1.0
 * @since 1.0
 */
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = -3487813096487445258L;
    @Getter
    private final String errorCode;

    public BusinessException(String errorCode) {
        this.errorCode = errorCode;
    }

    public BusinessException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }
    public BusinessException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getErrorDesc());
        this.errorCode = errorCodeEnum.getErrorCode();
    }
}
